home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / text / hyper / ADtoHT2_1.lha / Source.lha / MyLib.lha / stdio / fflush.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-04  |  565 b   |  26 lines

  1. #include <stdio.h>
  2. #include <errno.h>
  3.  
  4. #include <proto/dos.h>
  5.  
  6. /************************************************************************/
  7. /*                                    */
  8. /* Note: AmigaOS V37 Flush() won't work properly if you haven't done    */
  9. /* any buffered I/O on the stream yet. So, don't call fflush() if this    */
  10. /* is the case.                                */
  11. /*                                    */
  12. /************************************************************************/
  13.  
  14. int fflush(FILE *Stream)
  15.  
  16. {
  17.   int Result;
  18.  
  19.   Result=Flush(fileno(Stream)) ? 0 : EOF;
  20.   if (Result)
  21.     {
  22.       errno=IoErr();
  23.     }
  24.   return Result;
  25. }
  26.